
***CPS Bauhr and Charron replication file**

use "C:\Users\xchani\Desktop\PAPERS\french local gender corrupiton\Bauhr and Charron CPS data rd estimates.dta"

***********************************************************
***main table 1
************************************************************

**global regressio/difference of means
reg rev_sb_elec_periodw i.fem_win08, vce (cluster municipality)

ttest rev_sb_elec_periodw, by ( fem_win08)

**selecteting h**

rdbwselect  rev_sb_elec_periodw f_win_margin, all


***testing H1 - local linear regression using bandwidth from Calonico et al 2014
rdrobust  rev_sb_elec_periodw f_win_margin, kernel(triangular) p(1) bwselect(cerrd) vce (cluster municipality) all

**with h/2

rdrobust  rev_sb_elec_periodw f_win_margin, kernel(triangular) p(1) h(0.057) vce (cluster municipality) all

**with h*2

rdrobust  rev_sb_elec_periodw f_win_margin, kernel(triangular) p(1) h(0.228) vce (cluster municipality) all

**quadradic

rdrobust  rev_sb_elec_periodw f_win_margin, kernel(triangular) p(2) bwselect(cerrd) vce (cluster municipality) all

**cubic**
 
 rdrobust  rev_sb_elec_periodw f_win_margin, kernel(triangular) p(3) bwselect(cerrd) vce (cluster municipality) all
 
 *********************************************
 **further splits -  TABLE 2***
 **********************************************
 
 **1. new women versus all men
 
 reg  rev_sb_elec_periodw f_win_margin if new_w!=.,   vce (cluster municipality)
 
 rdrobust  rev_sb_elec_periodw f_win_margin if new_w!=., kernel(triangular) p(1) bwselect(cerrd) vce (cluster municipality) c(0) all
 
 rdrobust  rev_sb_elec_periodw f_win_margin if new_w!=., kernel(triangular) p(1) h(0.0502) vce (cluster municipality) c(0) all
 
 rdrobust  rev_sb_elec_periodw f_win_margin if new_w!=., kernel(triangular) p(1) h(0.208) vce (cluster municipality) c(0) all
 
  rdrobust  rev_sb_elec_periodw f_win_margin if new_w!=., kernel(triangular) p(2) bwselect(cerrd) vce (cluster municipality) c(0) all
  
 rdrobust  rev_sb_elec_periodw f_win_margin if new_w!=., kernel(triangular) p(3) bwselect(cerrd) vce (cluster municipality) c(0) all
 
 
 **2. incumbent women versus all men
 
 reg  rev_sb_elec_periodw f_win_margin if old_w!=.,   vce (cluster municipality)
 
 rdrobust  rev_sb_elec_periodw f_win_margin if old_w!=., kernel(triangular) p(1) bwselect(cerrd) vce (cluster municipality) c(0) all
 
 rdrobust  rev_sb_elec_periodw f_win_margin if old_w!=., kernel(triangular) p(1) h(0.0555) vce (cluster municipality) c(0) all
 
 rdrobust  rev_sb_elec_periodw f_win_margin if old_w!=., kernel(triangular) p(1) h(0.222) vce (cluster municipality) c(0) all
  
 rdrobust  rev_sb_elec_periodw f_win_margin if old_w!=., kernel(triangular) p(2) bwselect(cerrd) vce (cluster municipality) c(0) all
 
  rdrobust  rev_sb_elec_periodw f_win_margin if old_w!=., kernel(triangular) p(3) bwselect(cerrd) vce (cluster municipality) c(0) all
  
  
  ****same but with covariates for appendix (table A2)
  

global covariatesN "logPopDens re_elect year  turnout_r1 rounds ave_highEd  ave_t_wage no_firms com_firm"
 
  
  **1. new women versus all men
 
 reg  rev_sb_elec_periodw f_win_margin if new_w!=.,   vce (cluster municipality) covs($covariatesN)
 
 rdrobust  rev_sb_elec_periodw f_win_margin if new_w!=., kernel(triangular) p(1) bwselect(cerrd) vce (cluster municipality) c(0) all covs($covariatesN)
 
 rdrobust  rev_sb_elec_periodw f_win_margin if new_w!=., kernel(triangular) p(1) h(0.061) vce (cluster municipality) c(0) all covs($covariatesN)
 
 rdrobust  rev_sb_elec_periodw f_win_margin if new_w!=., kernel(triangular) p(1) h(0.246) vce (cluster municipality) c(0) all covs($covariatesN)
 
  rdrobust  rev_sb_elec_periodw f_win_margin if new_w!=., kernel(triangular) p(2) bwselect(cerrd) vce (cluster municipality) c(0) all covs($covariatesN)
  
 rdrobust  rev_sb_elec_periodw f_win_margin if new_w!=., kernel(triangular) p(3) bwselect(cerrd) vce (cluster municipality) c(0) all covs($covariatesN)
 
 
 **2. incumbent women versus all men
 
 rdrobust  rev_sb_elec_periodw f_win_margin if old_w!=., kernel(triangular) p(1) bwselect(cerrd) vce (cluster municipality) c(0) all covs($covariatesN)
 
 rdrobust  rev_sb_elec_periodw f_win_margin if old_w!=., kernel(triangular) p(1) h(0.0555) vce (cluster municipality) c(0) all covs($covariatesN)
 
 rdrobust  rev_sb_elec_periodw f_win_margin if old_w!=., kernel(triangular) p(1) h(0.222) vce (cluster municipality) c(0) all covs($covariatesN)
  
 rdrobust  rev_sb_elec_periodw f_win_margin if old_w!=., kernel(triangular) p(2) bwselect(cerrd) vce (cluster municipality) c(0) all covs($covariatesN)
 
  rdrobust  rev_sb_elec_periodw f_win_margin if old_w!=., kernel(triangular) p(3) bwselect(cerrd) vce (cluster municipality) c(0) all covs($covariatesN)
  
**difference in differnece of previous 2 estimates

ttesti  648 -.046 .042  747 -.049 .0388

ttesti  229 -.153 .074  177 -.154 .108

**********************************************************
*within estimators** figure 2 and Table A4**
********************************************************

use "C:\Users\xchani\Desktop\PAPERS\french local gender corrupiton\CPS within estimates.dta"

reg  SB_change_mean i.gen_change , vce (cluster municipality)

est sto b

reg  SB_change_mean i.gen_change pop_dens year  turnout_r1 listsr1 rounds ave_highEd wage_ineq ave_t_wage no_firms com_firm, vce (cluster municipality)

est sto f

coefplot f b, drop (_cons pop_dens year  turnout_r1 listsr1 rounds ave_highEd wage_ineq ave_t_wage no_firms com_firm) xline(0)


